import request from '@/router/axios';

//新增任务
export function addTask(query) {
    return request({
        url: '/cp/taskpub',
        method: 'post',
        data: query
    });
}

//编辑任务
export function editTask(query) {
    return request({
        url: '/cp/taskpub',
        method: 'put',
        data: query
    });
}

//查询任务列表
export function queryTask(query) {
    return request({
        url: '/cp/taskpub/page',
        method: 'get',
        params: query
    });
}

//查看详情任务列表
export function viewTask(id) {
    return request({
        url: `/cp/taskpub/${id}`,
        method: 'get'
    });
}

// 已完成成员名单
export function taskDetail_complete(obj) {
    return request({
        url: '/cp/taskpub/complete-employee',
        method: 'get',
        params: obj
    });
}

// 未完成成员名单
export function taskDetail_incomplete(obj) {
    return request({
        url: '/cp/taskpub/incomplete-employee',
        method: 'get',
        params: obj
    });
}

// 未完成成员提醒
export function taskNotice(obj) {
    return request({
        url: '/cp/taskpub/one-click-reminder',
        method: 'put',
        params: obj
    });
}

// 发布定时任务
export function pubTask(obj) {
    return request({
        url: '/cp//taskpub/release-task',
        method: 'put',
        params: obj
    });
}

// 撤销
export function revokeTask(id) {
    return request({
        url: `/cp/taskpub/revoke/${id}`,
        method: 'get'
    });
}

// 审批
export function approveTask(obj) {
    return request({
        url: `/cp/taskpub-approval/approval`,
        method: 'put',
        params: obj
    });
}

// 审批列表
export function approveTaskList(obj) {
    return request({
        url: `/cp/taskpub-approval/page`,
        method: 'get',
        params: obj
    });
}
